{extend name="frame/base" /}
{block name="body"}
<form action="{$url}" method="post">
    <label>分类名称<input name="name" id="name" type="text" value="{$info['name']|default=''}"/>
    </label>
    <label>展示类型<select id="type" name="type">
        <option value="0">文字列表</option>
        <option value="1">图片列表</option>
    </select>
    </label>
    <label>上级分类<select name="upid" id="upid">
        <option value="0">顶级分类</option>
        {volist name='upcatelist' id='cate'}
        <option value="{$cate['id']}">{$cate['name']}</option>
        {/volist}
    </select>
    </label>
    <label>分类别名<input name="alias" id="alias" type="text" value="{$info['alias']|default=''}"/>
    </label>
    <label>分类排序<input name="sort" id="sort" type="text" value="{$info['sort']|default='0'}"/>
    </label>
    <input type="submit" value="保存" onclick="submit_form();return false">
</form>
<br>
<script>
    var type="{$info['type']|default=''}";
    var upid="{$info['upid']|default=''}";
    $(function () {
        if(type!=""){
            $("#type").val(type)
        }
        if(upid!=""){
            $("#upid").val(upid)
        }

        $.datetimepicker.setLocale('ch');
        $('.some_class').datetimepicker({
            formatTime:'H:i',
            format:'Y-m-d H:i'
        });
    })
    function submit_form() {
        $("form").submit()
    }
</script>
{/block}
